#ifndef LOGINWIDGET_H
#define LOGINWIDGET_H

#include <QWidget>
#include <QString>
#include <QDateTime>
#include "databasemanager.h"
#include "usermanager.h"
#include "logmanagement.h"

namespace Ui {
class LoginWidget;
}

class LoginWidget : public QWidget
{
    Q_OBJECT

public:
    explicit LoginWidget(QWidget *parent = nullptr);
    ~LoginWidget();

    void setUserManager(UserManager* userManager);

private slots:
    void onLoginClicked();

signals:
    void sendMessage(const QString&);
    void display(int);
    void userDisplay(int);

private:
    Ui::LoginWidget *ui;
    DatabaseManager *m_pDatabaseManager;
    UserManager *m_pUserManager;
    QDateTime m_lastErrorTime;    // 记录上次错误时间
    QString m_lastError;          // 记录上次错误内容
};

#endif // LOGINWIDGET_H
